package com.rm.zeyou.mapper;

import com.rm.zeyou.entity.UserCollection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 收藏表 Mapper 接口
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:09
 */
@Mapper
public interface UserCollectionMapper extends BaseMapper<UserCollection> {
    @Select("select count(*) from t_user_collection  where user_id = #{id}")
    Integer selectrCollectionCount(@Param("id") Long id);

    @Delete("delete from t_user_collection where user_id = #{userId} and item_id = #{itemId}")
    Integer cancelCollection(@Param("userId") Long userId,@Param("itemId") Long itemId);
}
